
using System; 
using System.Runtime.InteropServices; 

namespace ServerHelper
{
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices.CharSet.Auto)]
    public struct SERVERDATA_SHAREDFOLDER
    {

        /// TCHAR[260]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)]
        public string id;

        /// TCHAR[260]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)]
        public string szPath;
    }

    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices.CharSet.Auto)]
    public struct SERVERDATA_MEDIA
    {

        /// TCHAR[260]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)]
        public string id;

        /// TCHAR[260]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)]
        public string ShareFolderPath;

        /// TCHAR[260]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)]
        public string szPath;

        /// TCHAR[260]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)]
        public string szName;

        /// TCHAR[260]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)]
        public string szThumbPath;

        /// boolean
        public bool isFolder;

        /// unsigned char*
        public System.IntPtr thumb;
    }

    public partial class ServerDataHelper
    {

        /// Return Type: int
        ///Count: int*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "GetShareFoldersCount")]
        public static extern int GetShareFoldersCount(ref int Count);


        /// Return Type: int
        ///Index: int
        ///pSharedFolder: SERVERDATA_SHAREDFOLDER*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "GetShareFolder")]
        public static extern int GetShareFolder(int Index, ref SERVERDATA_SHAREDFOLDER pSharedFolder);


        /// Return Type: int
        ///pszDataBasePath: TCHAR*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "InitServerData")]
        public static extern int InitServerData(System.IntPtr pszDataBasePath);


        /// Return Type: int
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "CloseServerData")]
        public static extern int CloseServerData();


        /// Return Type: int
        ///szShareFolderPath: TCHAR*
        ///Count: int*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "GetShareFolderMediasCount")]
        public static extern int GetShareFolderMediasCount(System.IntPtr szShareFolderPath, ref int Count);


        /// Return Type: int
        ///szShareFolderPath: TCHAR*
        ///nIndex: int
        ///pMedia: SERVERDATA_MEDIA*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "GetShareFolderMediasInfo")]
        public static extern int GetShareFolderMediasInfo(System.IntPtr szShareFolderPath, int nIndex, ref SERVERDATA_MEDIA pMedia);


        /// Return Type: int
        ///pPath: TCHAR*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "AddShareFolder")]
        public static extern int AddShareFolder(System.IntPtr pPath);


        /// Return Type: int
        ///pPath: TCHAR*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "RemoveShareFolder")]
        public static extern int RemoveShareFolder(System.IntPtr pPath);


        /// Return Type: int
        ///pMedia: SERVERDATA_MEDIA*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "AddSharedMediaInfo")]
        public static extern int AddSharedMediaInfo(ref SERVERDATA_MEDIA pMedia);


        /// Return Type: int
        ///pMedia: SERVERDATA_MEDIA*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "RemoveSharedMediaInfo")]
        public static extern int RemoveSharedMediaInfo(ref SERVERDATA_MEDIA pMedia);

    }
    public partial class HttpServerHelper
    {

        /// Return Type: void
        [System.Runtime.InteropServices.DllImportAttribute("LibHttpServer.dll", EntryPoint = "StartHomeServer")]
        public static extern void StartHomeServer();


        /// Return Type: void
        [System.Runtime.InteropServices.DllImportAttribute("LibHttpServer.dll", EntryPoint = "StopHomeServer")]
        public static extern void StopHomeServer();
    }
}